/**
 * 
 */
package com.yunhe.tomcat.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author 米mi
 *
 */
public class DataBaseUtil {

    /**
     * 驱动
     */
    public static String driver;
    
    /**
     * 地址
     */
    public static String url;
    
    /**
     * 用户名
     */
    public static String username;
    
    /**
     * 密码
     */
    public static String password;
    
    /**
     * 最大连接数
     */
    public static String maxPoolSize;
    
    static {
        Properties pro = new Properties();
        InputStream in = DataBaseUtil.class.getResourceAsStream("db.properties");
        
        try {
            // 读取db.properties
            pro.load(in);
            driver = pro.getProperty("driver").trim();
            url = pro.getProperty("url").trim();
            username = pro.getProperty("user_name").trim();
            password = pro.getProperty("password").trim();
            maxPoolSize = pro.getProperty("maxPoolSize").trim();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
